﻿<bc:BaseClient x:Class="WindSim.WindSimController" 
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
               xmlns:bc="clr-namespace:WindSim;assembly=WindSimBase"
               xmlns:Dashboarding="clr-namespace:Codeplex.Dashboarding;assembly=Codeplex.Dashboarding" 
               xmlns:tswitch="clr-namespace:ToggleSwitch;assembly=ToggleSwitch"
               xmlns:ext="http://schemas.xceed.com/wpf/xaml/toolkit"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               xmlns:simsrv="clr-namespace:WindSim.SimServiceReference;assembly=WindSimBase"
               xmlns:local="clr-namespace:WindSim"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
               xml:lang="de-DE"
               Title="WinSim Controller" Height="538.5" Width="789.333" ResizeMode="NoResize" 
               Loaded="Window_Loaded_1" Closing="Window_Closing_1" Icon="Images/Icon_Controller.png"
               DataContext="{Binding RelativeSource={RelativeSource Self}}" >
    <bc:BaseClient.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/WindSimBase;component/Resources/ResourceDictionary.xaml"/>
                <!--<ResourceDictionary Source="/WindSimBase;component/Resources/ExpressionDark.xaml"/>-->
                <ResourceDictionary Source="/WindSimBase;component/Resources/aero.normalcolor.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </bc:BaseClient.Resources>
    <bc:BaseClient.CommandBindings>
        <CommandBinding Command="{x:Static local:WindSimController.ManualControlCommand}" Executed="AddNewModel_Executed" />
    </bc:BaseClient.CommandBindings>
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFEDF3F9" Offset="1"/>
                <GradientStop Color="White"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="230"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="237*"/>
            <ColumnDefinition Width="24"/>
            <ColumnDefinition Width="238*"/>
            <ColumnDefinition Width="20"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="13"/>
            <RowDefinition Height="100*"/>
            <RowDefinition Height="9*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>            
        <!--Ribbon-Menue-->
        <r:Ribbon Grid.RowSpan="1" Grid.ColumnSpan="6" Margin="0,0,0,1">           
            <r:RibbonTab x:Name="rtMain" Header="Steuerung">
                
                <r:RibbonGroup Header="Modelle">
                    <r:RibbonButton Label="Modell hinzufügen" LargeImageSource="Images/WINDCRAFT.png" Click="rbtnAddModel_Click" Height="Auto"/>
                </r:RibbonGroup>
                <r:RibbonGroup Header="Zustand">
                    <tswitch:HorizontalToggleSwitch Name="tgbtnAnAus2" CheckedContent="An" UncheckedContent="Aus" IsChecked="{Binding SelectedItem.Value.PowerstateController, ElementName=lbConnectedModels, FallbackValue=false, Mode=TwoWay, Converter={StaticResource PowerToBoolConverter}}" Grid.Row="1" Checked="tgbtnAnAus_Checked" Unchecked="tgbtnAnAus_Unchecked" Margin="5,8,0,3" RenderTransformOrigin="1.11,1.22" HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="95" Height="22" BorderBrush="#A5000000" Grid.Column="1">
                        <tswitch:HorizontalToggleSwitch.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.ControlType" ElementName="lbConnectedModels"/>
                            </MultiBinding>
                        </tswitch:HorizontalToggleSwitch.IsEnabled>
                        <tswitch:HorizontalToggleSwitch.Effect>
                            <DropShadowEffect BlurRadius="6" ShadowDepth="0"/>
                        </tswitch:HorizontalToggleSwitch.Effect>
                    </tswitch:HorizontalToggleSwitch> 
                
                    <Button Content="{Binding SelectedItem.Value.FunctionstateModel, ElementName=lbConnectedModels, Converter={StaticResource FunctionToButtonTextConverter}, FallbackValue='Störung simulieren'}" Margin="5,3,0,3" Grid.Row="3" VerticalContentAlignment="Center" Grid.Column="1" FontSize="10" Click="btnStoerung_Click" Width="95" HorizontalAlignment="Left" Height="22">
                        <Button.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableFunctionstateButtonConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.PowerstateController" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.ControlType" ElementName="lbConnectedModels"/>
                            </MultiBinding>
                        </Button.IsEnabled>
                        <Button.Effect>
                            <DropShadowEffect BlurRadius="6" ShadowDepth="0"/>
                        </Button.Effect>
                    </Button>
                </r:RibbonGroup>
                <!--Auswahl Steuerungsart-->
                <r:RibbonGroup Header="Steuerung" Width="112">
                    <RadioButton Height="20" 
                                 Content="{x:Static simsrv:SimControlType.Manual}"
                                 IsChecked="{Binding SelectedItem.Value.ControlType, ElementName=lbConnectedModels, Converter={StaticResource EnumToBoolConverter}, 
                                            ConverterParameter={x:Static simsrv:SimControlType.Manual}, FallbackValue=true}"
                                 Checked="rbControlType_Checked" Margin="0,5,0,0">
                        <RadioButton.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Source="{x:Static simsrv:SimControlType.Manual}" />
                            </MultiBinding>
                        </RadioButton.IsEnabled>
                    </RadioButton>
                    <RadioButton Height="20" 
                                 Content="{x:Static simsrv:SimControlType.Automatic1}"
                                 IsChecked="{Binding SelectedItem.Value.ControlType, ElementName=lbConnectedModels, Converter={StaticResource EnumToBoolConverter}, 
                                            ConverterParameter={x:Static simsrv:SimControlType.Automatic1}, FallbackValue=false}"
                                 Checked="rbControlType_Checked">
                        <RadioButton.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Source="{x:Static simsrv:SimControlType.Manual}" />
                            </MultiBinding>
                        </RadioButton.IsEnabled>
                    </RadioButton>
                    <RadioButton Height="20" 
                                 Content="{x:Static simsrv:SimControlType.Automatic2}"
                                 IsChecked="{Binding SelectedItem.Value.ControlType, ElementName=lbConnectedModels, Converter={StaticResource EnumToBoolConverter}, 
                                            ConverterParameter={x:Static simsrv:SimControlType.Automatic2}, FallbackValue=false}"
                                 Checked="rbControlType_Checked">
                        <RadioButton.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Source="{x:Static simsrv:SimControlType.Manual}" />
                            </MultiBinding>
                        </RadioButton.IsEnabled>
                    </RadioButton>
                </r:RibbonGroup>
                
                <!--Einstellungen Wind-->
                <r:RibbonGroup Header="Wind" Margin="0,1" Width="380">
                    <r:RibbonTwoLineText Text="Geschw.:" Height="18" Margin="10,0,20,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                    <r:RibbonTwoLineText Text="Richtung:" Height="24" Margin="10,0,10,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                    <r:RibbonTwoLineText Text="" Height="18"/>
                    <Slider Name="sldWindSpeed" Value="{Binding SelectedItem.Value.WindSpeed, ElementName=lbConnectedModels, FallbackValue=0, Mode=TwoWay}" Width="230" Minimum="0" Maximum="30"  IsSnapToTickEnabled="True" Height="30" ValueChanged="sldWindSpeed_ValueChanged" TickFrequency="0.1">
                        <Slider.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.ControlType" ElementName="lbConnectedModels"/>
                            </MultiBinding>
                        </Slider.IsEnabled>
                    </Slider>
                    <Slider Name="sldWindDirection" Value="{Binding SelectedItem.Value.WindDirection, ElementName=lbConnectedModels, FallbackValue=0, Mode=TwoWay}" Width="230" Minimum="0" Maximum="360" TickFrequency="0.1"  IsSnapToTickEnabled="True" ValueChanged="sldWindDirection_ValueChanged">
                        <Slider.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.ControlType" ElementName="lbConnectedModels"/>
                            </MultiBinding>
                        </Slider.IsEnabled>
                    </Slider>
                    <r:RibbonTwoLineText Text="{Binding Value, ElementName=sldWindSpeed, Converter={StaticResource WindSpeedToStringConverter}}" Height="18" Margin="0,0,0,5"/>
                    <r:RibbonTwoLineText Text="{Binding Value, ElementName=sldWindDirection, Converter={StaticResource DegreeToCompassDirectionConverter}, FallbackValue='N'}" Height="24"/>
                </r:RibbonGroup>
                
                <r:RibbonGroup Header="Tageszeit" Margin="0,1" Width="70">
                    <ext:DateTimeUpDown Value="{Binding SelectedItem.Value.DayTime, ElementName=lbConnectedModels, FallbackValue=14:00, StringFormat=HH:mm, Mode=OneWay}"  Format="ShortTime" CultureInfo="de-DE" DefaultValue="11/14/2012 12:00:00" ValueChanged="dtudDayTime_ValueChanged" HorizontalAlignment="Center">
                        <ext:DateTimeUpDown.IsEnabled>
                            <MultiBinding Converter="{StaticResource EnableControlsConverter}">
                                <Binding />
                                <Binding Path="SelectedItem" ElementName="lbConnectedModels"/>
                                <Binding Path="SelectedItem.Value.ControlType" ElementName="lbConnectedModels"/>
                            </MultiBinding>
                        </ext:DateTimeUpDown.IsEnabled>
                    </ext:DateTimeUpDown>     
                </r:RibbonGroup>
            </r:RibbonTab>
        </r:Ribbon>
            <!--GroupBox Zustand-->
        <GroupBox Header="Zustand" Grid.Row="2" Grid.Column="2" Margin="0" BorderThickness="1" BorderBrush="#FFB9C9DA" Grid.ColumnSpan="3">
            <GroupBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                    <GradientStop Color="#FFDFE9F5" Offset="0.996"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </GroupBox.Background>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="7"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="8"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="4"/>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="6"/>
                </Grid.RowDefinitions>
                <Label Content="Betriebszustand:" Grid.Column="1" Margin="0" Grid.Row="1" VerticalContentAlignment="Center"/>

                <Dashboarding:RoundLed Width="14" Height="14" Margin="0" IsTrue="{Binding  SelectedItem.Value.PowerstateModel, ElementName=lbConnectedModels, Converter={StaticResource PowerToBoolConverter}}" RenderTransformOrigin="13.949,8.346" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Dashboarding:RoundLed.Effect>
                        <DropShadowEffect ShadowDepth="0" BlurRadius="8"/>
                    </Dashboarding:RoundLed.Effect>
                    <Dashboarding:RoundLed.TrueColor>
                        <Dashboarding:ColorPoint HiColor="#FF589C11" LowColor="Beige" Value="9"/>
                    </Dashboarding:RoundLed.TrueColor>
                    <Dashboarding:RoundLed.FalseColor>
                        <Dashboarding:ColorPoint HiColor="Gray" LowColor="AntiqueWhite" Value="9"/>
                    </Dashboarding:RoundLed.FalseColor>
                </Dashboarding:RoundLed>
                <Label Content="Störung:" Grid.Column="1" Margin="0" Grid.Row="3" VerticalContentAlignment="Center"/>
                
                <!--LED Functionstate-->
                <Dashboarding:RoundLed Style="{StaticResource FunctionstateLEDStyle}" Width="14" Height="14" Margin="0" IsTrue="{Binding SelectedItem.Value.FunctionstateModel, ElementName=lbConnectedModels, Converter={StaticResource FunctionToBoolConverter}, FallbackValue=false}" RenderTransformOrigin="13.949,8.346" Grid.Column="2" Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Dashboarding:RoundLed.Effect>
                        <DropShadowEffect ShadowDepth="0" BlurRadius="8"/>
                    </Dashboarding:RoundLed.Effect>
                    <Dashboarding:RoundLed.TrueColor>
                        <Dashboarding:ColorPoint HiColor="#FFBE0707" LowColor="AntiqueWhite" Value="9"/>
                    </Dashboarding:RoundLed.TrueColor>
                    <Dashboarding:RoundLed.FalseColor>
                        <Dashboarding:ColorPoint HiColor="Gray" LowColor="AntiqueWhite" Value="9"/>
                    </Dashboarding:RoundLed.FalseColor>
                </Dashboarding:RoundLed>                    
            </Grid>
        </GroupBox>
        
        <!--GroupBox Leistung-->
        <GroupBox Header="Leistung" Grid.Row="4" Grid.Column="2" Margin="0,0,1,0" BorderThickness="1" BorderBrush="#FFB9C9DA">
            <GroupBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                    <GradientStop Color="#FFDFE9F5" Offset="0.996"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </GroupBox.Background>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="7"/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="8"/>
                    <RowDefinition Height="135"/>
                    <RowDefinition/>
                    <RowDefinition Height="6"/>
                </Grid.RowDefinitions>
                <Dashboarding:Dial360 Grid.Column="1" Margin="-28,0,0,0" Grid.Row="1" Value="{Binding SelectedItem.Value.Energy, ElementName=lbConnectedModels, FallbackValue=0, Converter={StaticResource PowerToDashboardValueConverter}}" Maximum="3" Height="Auto" Width="Auto" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Dashboarding:Dial360.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="0.8" ScaleX="0.8"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Dashboarding:Dial360.RenderTransform>
                    <Dashboarding:Dial360.Effect>
                        <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
                    </Dashboarding:Dial360.Effect>
                </Dashboarding:Dial360>

                <Label Content="Aktuell:" Grid.Column="1" Margin="0" Grid.Row="2" VerticalContentAlignment="Center"/>
                <Label Content="{Binding SelectedItem.Value.Energy, ElementName=lbConnectedModels, Converter={StaticResource PowerToStringConverter}, FallbackValue=0}" Grid.Column="2" Margin="0" Grid.Row="2" VerticalContentAlignment="Center"/>
            </Grid>
        </GroupBox>

        <!--GroupBox Rotordrehzahl-->
        <GroupBox Header="Rotordrehzahl" Grid.Row="4" Grid.Column="4" Margin="0,0,1,0" BorderThickness="1" BorderBrush="#FFB9C9DA">
            <GroupBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                    <GradientStop Color="#FFDFE9F5" Offset="0.996"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </GroupBox.Background>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="7"/>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="8"/>
                    <RowDefinition Height="135"/>
                    <RowDefinition/>
                    <RowDefinition Height="6"/>
                </Grid.RowDefinitions>
                <Dashboarding:Dial360 Grid.Column="1" Margin="-28,0,0,0" Grid.Row="1" Value="{Binding SelectedItem.Value.RPM, ElementName=lbConnectedModels, FallbackValue=0}" Maximum="20" Height="Auto" Width="Auto" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Top" HorizontalAlignment="Center">
                    <Dashboarding:Dial360.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleY="0.8" ScaleX="0.8"/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </Dashboarding:Dial360.RenderTransform>
                    <Dashboarding:Dial360.Effect>
                        <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
                    </Dashboarding:Dial360.Effect>
                </Dashboarding:Dial360>
                <Label Content="Aktuell:" Grid.Column="1" Margin="0" Grid.Row="2" VerticalContentAlignment="Center"/>
                <Label Content="{Binding SelectedItem.Value.RPM, ElementName=lbConnectedModels, Converter={StaticResource RPMToStringConverter}, FallbackValue=0}" Grid.Column="2" Margin="0" Grid.Row="2" VerticalContentAlignment="Center"/>
            </Grid>
        </GroupBox>

        <!--ListBox verbundene Modelle-->
        <ListBox x:Name="lbConnectedModels" Grid.RowSpan="6" Margin="0" Grid.Row="1" ItemContainerStyle="{StaticResource ConnectedModelsItemContainer}" OverridesDefaultStyle="True" Foreground="Black" BorderThickness="2,0,1,0">
            <ListBox.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFCFDBE9"/>
                    <GradientStop Color="White" Offset="1"/>
                    <GradientStop Color="#FF959595" Offset="0.473"/>
                </LinearGradientBrush>
            </ListBox.BorderBrush>
            <ListBox.Background>
                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                    <GradientStop Color="#FFFAFCFD"/>
                    <GradientStop Color="#FFEEF4F9" Offset="1"/>
                </LinearGradientBrush>
            </ListBox.Background>
        </ListBox>

        <!--<Dashboarding:Dial360 Grid.Column="3" Grid.Row="4" Value="{Binding SelectedItem.Value.RPM, ElementName=lbConnectedModels, FallbackValue=0}" Maximum="20" Height="Auto" RenderTransformOrigin="0.5,0.5" Margin="41,47,64,-17" Width="Auto" Grid.RowSpan="2" Grid.ColumnSpan="2">
            <Dashboarding:Dial360.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Dashboarding:Dial360.RenderTransform>
            <Dashboarding:Dial360.Effect>
                <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
            </Dashboarding:Dial360.Effect>
        </Dashboarding:Dial360>-->
        
        <StatusBar Grid.Row="6" Grid.ColumnSpan="6" BorderThickness="0,1,0,0" BorderBrush="#FFB9C9DA">
            <StatusBar.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFDFE9F5" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </StatusBar.Background>
            <StatusBarItem>
                <Label Content="{Binding StatusbarInfo}" FontSize="10" />
            </StatusBarItem>
        </StatusBar>

        <Border Name="borSearchService" Grid.RowSpan="6" Grid.ColumnSpan="6" Visibility="{Binding IsConnected, Converter={StaticResource IsConnectedToVisibleOrCollapsedConverter}, FallbackValue=Collapsed}">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFEDF3F9" Offset="1"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="344*"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="342*"/>
                    <ColumnDefinition Width="40"/>
                </Grid.ColumnDefinitions>
                <Label Content="{Binding SearchServiceCaption}" Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontWeight="Bold" Grid.Column="1" Margin="0"/>
                <ProgressBar Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="3" Width="333" Height="14" IsIndeterminate="{Binding IsSearching}" Value="0" >
                    <ProgressBar.Foreground>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FF61A7EE" Offset="0.009"/>
                            <GradientStop Color="#4C3399FF" Offset="0.983"/>
                        </LinearGradientBrush>
                    </ProgressBar.Foreground>
                </ProgressBar>
                <TextBlock Text="{Binding SearchServiceStatusMessage}" Grid.Row="4" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" Grid.Column="1" Margin="0" TextWrapping="WrapWithOverflow" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
                <Button Content="Suche erneut starten" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3" Width="186" FontSize="14" Click="btnRetrySearchService_Click">
                    <Button.Visibility>
                        <MultiBinding Converter="{StaticResource ShowRetryServiceSearchButtonConverter}">
                            <Binding/>
                            <Binding Path="IsConnected"/>
                            <Binding Path="IsSearching"/>
                        </MultiBinding>
                    </Button.Visibility>
                </Button>
            </Grid>
        </Border>
    </Grid>
</bc:BaseClient>